//
//  RecommendCollectionViewCell.m
//  SweetComics
//
//  Created by dlios on 15-1-31.
//  Copyright (c) 2015年 LeeZhe. All rights reserved.
//

#import "RecommendCollectionViewCell.h"
#import "UIImageView+WebCache.h"
@implementation RecommendCollectionViewCell

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        _label = [[UILabel alloc]init];
       
        _label.font = [UIFont boldSystemFontOfSize:12];
        _label.textAlignment = NSTextAlignmentLeft;
        [self.contentView addSubview:_label];
        [_label release];
        
        _imageView = [[UIImageView alloc]init];
        [self.contentView addSubview:_imageView];
        _imageView.image = [UIImage imageNamed:@"kuu.png"];
        [_imageView release];
        _label1 = [[UILabel alloc]init];
        _label1.font = [UIFont boldSystemFontOfSize:11];
        _label1.textAlignment = NSTextAlignmentRight;
        [self.contentView addSubview:_label1];
        _label1.textColor = [UIColor orangeColor];
        [_label1 release];
        
        
        
        
    }
    return self;
}



- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    self.imageView.frame = CGRectMake(0, 0, layoutAttributes.size.width, layoutAttributes.size.height / 5 * 4);
    
    self.label.frame = CGRectMake(0, layoutAttributes.size.height / 5 * 4, layoutAttributes.size.width - 20, layoutAttributes.size.height / 5);
    self.label1.frame = CGRectMake(layoutAttributes.size.width / 2, layoutAttributes.size.height / 5 *4, layoutAttributes.size.width / 2, layoutAttributes.size.height / 5);
    
}
- (void)setComicList:(ComicList *)comicList
{
    NSURL *url = [NSURL URLWithString:comicList.cover_url];
    [self.imageView setImageWithURL:url];
}















@end
